//
//  TCMessageViewController.m
//  陶瓷
//
//  Created by 王戈 on 15/7/27.
//  Copyright (c) 2015年 王戈. All rights reserved.
//


#import "TCMessageViewController.h"
#import "TCMessageCell.h"

@interface TCMessageViewController ()

@property (nonatomic, strong) NSArray *dataSource;
@property (nonatomic, strong) NSArray *messages;


@end

@implementation TCMessageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}

- (void)viewWillAppear:(BOOL)animated {
    
}

- (NSArray *)dataSource {
    if (_dataSource == nil) {
        NSArray *data1 = @[@"人才招聘",@"精英级人才聚集地",@"blue_line"];
        NSArray *data2 = @[@"转让招租",@"仓库、店铺转让主粗",@"deepblue_line"];
        NSArray *data3 = @[@"发布尾货",@"尾货甩货中心",@"purple_line"];
        _dataSource = @[data1, data2 ,data3];
    }
    return _dataSource;
}

- (void)refreshMessages {
    // 获得发布信息列表
    [SVProgressHUD showWithStatus:@"正在获取信息列表 请稍后.."];
    [[TCNetworkTool sharedNetTool] messageListWithPn:@"1" andSuccessBlocks:^(NSArray *resultArray) {
        
        
    } andFailureBlocks:^(NSString *failureMessage) {
        
    }];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 3;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    TCMessageCell *cell = [TCMessageCell cellWithTableView:tableView];
    cell.modelArray = self.dataSource[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
}

@end
